﻿<Window x:Class="MDCAdminTool.Controls.AddDataCacheItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"     
    Title="Add Data Cache Item" Height="270" Width="260" 
    Padding="15"
    Name="AddCacheItemWin"
    WindowStyle="ToolWindow" 
    WindowStartupLocation="CenterOwner">

    <Grid>
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="CacheItemAdded" SourceObject="{Binding}">
                <ei:CallMethodAction 
                    MethodName="Close" 
                    TargetObject="{Binding ElementName=AddCacheItemWin}"/>
            </i:EventTrigger>
        </i:Interaction.Triggers>

        <DockPanel Margin="8">
            <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right" Margin="0,8,0,0">
                <Button Height="23" Width="75" Margin="5,0,5,0" Content="Cancel" IsCancel="True" >
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <ei:CallMethodAction 
                                MethodName="Close" 
                                TargetObject="{Binding ElementName=AddCacheItemWin}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
                <Button Height="23" Width="75" Margin="5,0,0,0" Content="Save"   IsDefault="True" >
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <ei:CallMethodAction 
                                MethodName="AddCacheItem" 
                                TargetObject="{Binding}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
            </StackPanel>

            <GroupBox DockPanel.Dock="Top" Margin="0,0,0,25">
                <GroupBox.Header>
                    <StackPanel Orientation="Horizontal">
                        <StaticResource ResourceKey="GetHostConfig16" />
                        <TextBlock Text="Data Cache Item" Margin="5,0,0,0"/>
                    </StackPanel>
                </GroupBox.Header>
                <Grid x:Name="gridCacheClusterConfigFile">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Label Content="Key:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBox 
                        Text="{Binding Key}"
                        Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Name="tbKey"  VerticalAlignment="Center" Width="120" />

                    <Label Content="Value:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBox 
                        Text="{Binding Value}"
                        Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="3" Name="tbValue"  VerticalAlignment="Center" Width="120" />

                </Grid>
            </GroupBox>

            <GroupBox>
                <GroupBox.Header>
                    <StackPanel Orientation="Horizontal">
                        <StaticResource ResourceKey="GetHostConfig16" />
                        <TextBlock Text="Data Cache Item" Margin="5,0,0,0"/>
                    </StackPanel>
                </GroupBox.Header>
                <Grid x:Name="a">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Label Content="Number:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBox 
                        Text="{Binding Number}"
                        Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Name="tbNumber"  VerticalAlignment="Center" Width="120" />

                </Grid>
            </GroupBox>
        </DockPanel>
    </Grid>
</Window>
